package com.zx.BookSeaReader.ui.label;

import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.zx.BookSeaReader.R;
import com.zx.BookSeaReader.greendao.entity.BookLabelBean;
import com.zx.BookSeaReader.ui.base.adapter.ViewHolderImpl;
import com.zx.BookSeaReader.util.Constant;
import com.zx.BookSeaReader.util.StringUtils;


public class LabelHolder extends ViewHolderImpl<BookLabelBean> {

    private TextView mTvLabelName;
    private TextView mTvChapterName;
    private TextView mTvLabelTime;

    @Override
    public void initView() {
        mTvLabelName = findById(R.id.tv_label_name);
        mTvChapterName = findById(R.id.tv_chapter_name);
        mTvLabelTime = findById(R.id.tv_label_time);
    }

    @Override
    public void onBind(BookLabelBean data, int pos) {

        mTvLabelName.setText(data.getTitle());
        mTvChapterName.setText("章节位置："+data.getChapterName());
        mTvLabelTime.setText(StringUtils.dateConvert(data.getLabelTime(), Constant.FORMAT_BOOK_DATE));


    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_label;
    }
}
